package com.fly.lambda.dao;

import com.fly.lambda.domain.Channel;
import com.fly.lambda.framework.dao.BaseDAO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Fly on 2016/7/13.
 */
@Repository
public class ChannelDAO extends BaseDAO<Channel> {

    public List<Channel> getListByParentId(String parentId){
        String hql = "from Channel where parentChannel.channelId = ? order by channelNum desc";
        return doQueryList(hql, true, parentId);
    }

    public List<Channel> getListByLevel(int level){
        String hql = "from Channel where channelLevel = ? order by channelNum desc";
        return doQueryList(hql, true, level);
    }

}
